import absent_index from "@/views/absent/index.vue"
import frame from "@/views/main/frame.vue"
import myabsent from "@/views/absent/my.vue"
import subabsent from "@/views/absent/sub.vue"
import informdetail from "@/views/inform/detail.vue"
import informlist from "@/views/inform/list.vue"
import publishinform from "@/views/inform/publish.vue"
import staffadd from "@/views/staff/add.vue"
import stafflist from "@/views/staff/list.vue"
import home from "@/views/home/home.vue"
import inform_index from "@/views/inform/index.vue"
import staff_index from "@/views/staff/index.vue"
import { PermissionChoices } from "@/stores/auth"

const routes = [
    {
        path: '/',
        name: 'frame',
        component: frame,
        children: [
            {
                path: "/", name: "home", component: home,
                meta: {
                    icon: "HomeFilled",
                    text: "首页",
                    permissions: [PermissionChoices.Normal],
                },
            },
            {
                path: "/absent", name: "absent", component: absent_index,
                meta: {
                    icon: "Checked",
                    text: "考勤管理",
                    permissions: [PermissionChoices.Normal],
                },
                children: [
                    {
                        path: 'my', name: "myabsent", component: myabsent,
                        meta: {
                            icon: "UserFilled",
                            text: "个人考勤",
                            permissions: [PermissionChoices.Normal],
                        },
                    },
                    {
                        path: 'sub', name: "subabsent", component: subabsent,
                        meta: {
                            icon: "User",
                            text: "下属考勤",
                            permissions: [PermissionChoices.Leader, PermissionChoices.highest],
                        },
                    }
                ]
            },
            {
                path: '/inform', name: "inform", component: inform_index,
                meta: {
                    icon: "BellFilled",
                    text: "通知管理",
                    permissions: [PermissionChoices.Normal],

                },
                children: [
                    {
                        path: 'publish', name: "inform_publish", component: publishinform,
                        meta: {
                            icon: "CirclePlusFilled",
                            text: "发布通知",
                            permissions: [PermissionChoices.Leader, PermissionChoices.highest],
                        },
                    },
                    {
                        path: 'list', name: "inform_list", component: informlist,
                        meta: {
                            icon: "list",
                            text: "通知列表",
                            permissions: [PermissionChoices.Normal],
                        },
                    },
                    {
                        path: 'detail/:pk', name: "inform_detail", component: informdetail,
                        meta: {
                            hidden: true
                        },
                    },
                ]
            },
            {
                path: '/staff', name: "staff_index", component: staff_index,
                meta: {
                    icon: "Avatar",
                    text: "员工管理",
                    permissions: [PermissionChoices.Leader, PermissionChoices.highest],
                },
                children: [
                    {
                        path: 'add', name: "staffadd", component: staffadd,
                        meta: {
                            icon: "CirclePlusFilled",
                            text: "新增员工",
                            permissions: [PermissionChoices.Leader, PermissionChoices.highest],
                        },
                    },
                    {
                        path: 'list', name: "stafflist", component: stafflist,
                        meta: {
                            icon: "List",
                            text: "员工列表",
                            permissions: [PermissionChoices.Leader, PermissionChoices.highest],
                        },
                    }
                ]
            },
        ]
    }
]

export default routes